package com.DHH.Service.Base.Impl;
import com.DHH.Entity.Base.BaseUserInfo;
import com.DHH.Mapper.Base.BaseUserInfoMapper;
import com.DHH.Service.Base.IBaseUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BaseUserInfoServiceImpl implements IBaseUserInfoService{
	
	@Autowired
    private BaseUserInfoMapper baseUserInfoMapper;
    
   @Override
   public BaseUserInfo insertBaseUserInfo(BaseUserInfo baseUserInfo){
	   
        baseUserInfoMapper.insertSelective(baseUserInfo);
	   return baseUserInfo;
	   
   };
   @Override
   public BaseUserInfo updateBaseUserInfo(BaseUserInfo baseUserInfo){
	     baseUserInfoMapper.updateByPrimaryKeySelective(baseUserInfo);
        return baseUserInfo;
   };
   @Override
   public BaseUserInfo deleteBaseUserInfo(BaseUserInfo baseUserInfo){

	     baseUserInfoMapper.delete(baseUserInfo);
        return baseUserInfo;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public BaseUserInfo saveOrUpdateBaseUserInfo(BaseUserInfo baseUserInfo){
        if(baseUserInfo.getId()==null)
        {
            baseUserInfoMapper.insertSelective(baseUserInfo);
        }else{
            baseUserInfoMapper.updateByPrimaryKeySelective(baseUserInfo);
        }
        return baseUserInfo;
    };
}
